import cascader from "../api/cascader";


const addr = (value) => {
    let text = ""
    cascader.every(c => {
        if (value[0] === c.value) {
            GetText(c.children, value, 1)
            text += c.label
            return false
        }
        return true
    })

    function GetText(arr, value, num) {
        if (num < value.length) {
            arr.every(v => {
                if (v.value === value[num]) {
                    text += v.label
                    GetText(v.children, value, num + 1)
                    return false
                }
                return true
            })
        } else {
            return
        }
    }

    return text
}

export default addr
